import sqlite3
from dao.user_dao import new_user,select_user,select_user_by_username

current_user=""




def register_verify(username):
    print("register_verify")
    print(select_user_by_username(username))
    print("usernmae",username)
    if select_user_by_username(username): # 用户名已存在
        return False
    else:
        return True

def register(username,password,email,exam):
    print("register")
    new_user(username,password,email,exam)


def login_verify(username,password)->bool:
    if select_user(username,password):
        current_user = username
        return True
    else:
        return False


